//
// Created by 123 on 2025/1/2.
//
#include "iostream"
using namespace std;

class MyPrint{
public:
    void operator()(string text){
        cout << text << endl;
    }
};
void test1(){
    MyPrint myPrint;
    myPrint("hello world 1");
}

class MyAdd{
public:
    int operator()(int v1,int v2){
        return v1+v2;
    }
};

void test2(){
    MyAdd myAdd;
    int ret = myAdd(10,10);
    cout << "ret==" << ret << endl;
    //匿名对象调用
    cout << "MyAdd(100,100)==" << MyAdd()(100,100) << endl;
}

int main077(){
    test1();
    test2();

    return 0;
}